# encoding:utf-8
import sys
sys.path.append('..')
############################系统配置############################
PICTURE_SAVE_LOCAL = False
PICTURE_SAVE_PATH = 'D://syswin_spider//images'
PICTURE_REPLACE_PREFIX = 'images'
MAX_RETRIES = 5
TIME_OUT = 30
MAX_CONNECTIONS = 10



############################Redis配置############################
PICTURE_SAVE_LOCAL = False
PICTURE_SAVE_PATH = 'D://syswin_spider//images'
PICTURE_REPLACE_PREFIX = 'images'
MAX_RETRIES = 5
TIME_OUT = 30
MAX_CONNECTIONS = 10
###########################Mysql配置###########################
MYSQL_USERNAME = 'DRPool'
MYSQL_PASSWORD = 'DbPool@DW167'
DB_HOST = '172.28.19.167'
DB_PORT = 3316

DB_CONF = {
    'host': 'mysql+pymysql://{username}:{password}@{db_host}:{db_port}/dataresourcespool?charset=utf8mb4'.format(
        username=MYSQL_USERNAME,
        password=MYSQL_PASSWORD,
        db_host=DB_HOST,
        db_port=DB_PORT
    )
}
###########################Mongp配置###########################
MONGO_USERNAME = 'hadoop'
MONGO_PWD = 'TooNPro480'
MONGO_HOST = '172.28.20.195'
MONGO_PORT = 37019
MONGO_DB = 'hadoopqq'

MONGO_CONF = {
    'uri' :"mongodb://{username}:{pwd}@{host}:{port}/{db}".format(username=MONGO_USERNAME, pwd=MONGO_PWD, host=MONGO_HOST, port=MONGO_PORT, db=MONGO_DB)   
    
    } 
################ ###########云上传############ ###############
OSS_UPLOAD_URL='http://scloud.toon.mobi/uploadFile'
OSS_APPID='1015'
OSS_APPSECRET='cfdb9af543e79a5c5fa1d555926af2ba'
################ ###########日志配置############ ###############
LOGGING_CONFIG = {
    'version': 1,
    'disable_existing_loggers': True,

    'formatters': {
        'default': {
            'format': '%(asctime)s- %(module)s:%(lineno)d [%(levelname)1.1s] %(name)s: %(message)s',
            'datefmt': '%Y/%m/%d %H:%M:%S'
        },
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'formatter': 'default',
            'class': 'logging.StreamHandler',
        },
        'file': {
            'level': 'WARNING',
            'formatter': 'default',
            'class': 'logging.FileHandler',
            'filename': 'spider_log.txt',
            'encoding': 'utf8'
        },
    },
    'loggers': {
        '': {
            'handlers': ['console', 'file'],
            'level': 'DEBUG',
            'propagate': False,
        },
        'app': {
            'handlers': ['console', 'file'],
            'level': 'DEBUG',
            'propagate': False,
        },
        'tornado': {
            'handlers': ['console', 'file'],
            'level': 'INFO',
            'propagate': False,
        },
    },
}
